package cn.onein.edu.backend.job;

import org.apache.log4j.Logger;

import cn.onein.edu.common.MailType;
import cn.onein.edu.util.ResourceUtil;


public class WeeklyMailSendJob extends BaseJob{
	Logger logger = Logger.getLogger(WeeklyMailSendJob.class);

	@Override
	public void start() {
		logger.info("WeeklyMailSendJob start");
		//发送开始邮件
		String userEmail = ResourceUtil.getJobMonitorMailProperties().getString("MAIN_MONITOR_MAIL");
		getSendMailProducer().sendJobMailMessage(MailType.JobStart, JobType.WeeklyMailSendJob, userEmail);
		
		try{
			// TODO: WeeklyMailSendJob
			
			logger.info("WeeklyMailSendJob end");
			//发送结束邮件
			getSendMailProducer().sendJobMailMessage(MailType.JobEnd, JobType.WeeklyMailSendJob, userEmail);
		}
		catch(Exception ex){
			logger.info("WeeklyMailSendJob error");
			//发送出错邮件
			getSendMailProducer().sendJobMailMessage(MailType.JobError, JobType.WeeklyMailSendJob, userEmail);
		}
	}
}
